package com.situ.gcbs.server.util;

import jakarta.servlet.http.HttpServletRequest;

/**
 * 功能：请求工具类
 *
 * @author 千堆雪
 * @version 1.0.0
 * @since 2024/5/16
 * <p>
 * created by 千堆雪 on 2024/5/16 10:19, last modified by 千堆雪 on 2024/5/16 10:19
 */
public abstract class Requests {
    /**
     * 判断是否ajax请求
     *
     * @param request 请求对象
     * @return 是否ajax请求
     */
    public static boolean isAjaxRequest(HttpServletRequest request) {
        String requestType = request.getHeader("X-Requested-With");
        return "XMLHttpRequest".equals(requestType);
    }
}
